# Maintainer: xaiviax (xaiviax at comcast dot net)
# Update: Carbon Jiao  Added autoshutdown support.

pkgname=deluge-svn
pkgver=5344
pkgrel=1
pkgdesc="python和pygtk写的BT下载软件，加入了autoshutdown插件"
arch=('i686' 'x86_64')
url="http://deluge-torrent.org/"
license=('GPL2')
depends=('pygtk' 'boost' 'pyxdg' 'dbus-python' 'librsvg' 'desktop-file-utils'
         'hicolor-icon-theme' 'setuptools' 'patch' 'pyopenssl' 'twisted')
makedepends=('subversion' 'intltool' 'boost')
conflicts=('deluge')
provides=('deluge')
options=('!emptydirs')
install=deluge.install
source=(AutoShutdown-0.1-py2.5.egg::http://blogimg.chinaunix.net/blog/upfile2/090414223440.zip)
md5sums=()

_svntrunk="http://svn.deluge-torrent.org/trunk/"
_svnmod="trunk"

build() {
  cd $startdir/src

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  cp -r $_svnmod $_svnmod-build
  cd $_svnmod-build  

  python setup.py build
  python setup.py install --root=$startdir/pkg

  install -m644 $srcdir/AutoShutdown-0.1-py2.5.egg $pkgdir/usr/lib/python2.6/site-packages/deluge/plugins/
   
  rm  -rf  $startdir/src/$_svnmod-build
}
